const type = {
  SET_ORDER: 'SET_ORDER'
};

const state = {
  order: {}
};

const getters = {
  order: state => state.order
};

const mutations = {
  [type.SET_ORDER](state, order) {
    if (order) state.order = order;
    else state.order = {}
  }
};

const actions = {
  setOrder: ({commit}, order) => {
    commit(type.SET_ORDER, order)
  }
};

export default {
  state,
  getters,
  mutations,
  actions
}
